\hypertarget{class_client}{
\section{Client类参考}
\label{class_client}\index{Client@{Client}}
}


客户端类  




{\ttfamily \#include $<$client.h$>$}

\subsection*{公有成员}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{class_client_a772c7deb25a57164e39f6c798140f21e}{addConnection} (\hyperlink{class_connection}{Connection} $\ast$)
\item 
int \hyperlink{class_client_a12eaa3ff4cac47109acb0764c0b689bf}{startListen} (int lisPort=0)
\item 
void \hyperlink{class_client_aef909de08ef481be9e915bd4deb81107}{stopListen} ()
\item 
void \hyperlink{class_client_abfd2a6d2e31f7ad05b6003b6900bedcc}{startCon} ()
\item 
void \hyperlink{class_client_a456d3e393b75a3409d2a4d2991365c33}{startCon} (unsigned short port, const char $\ast$\hyperlink{struct____addr}{addr}, const int nRequest, const std::string \&str)
\item 
void \hyperlink{class_client_adfe393bc28758353b25b900d9bb2ea7d}{waitForCon} ()
\end{DoxyCompactItemize}
\subsection*{静态公有成员}
\begin{DoxyCompactItemize}
\item 
static \hyperlink{class_client}{Client} $\ast$ \hyperlink{class_client_ae57819d17e2d00f7235adcc99ca13d90}{getSingleClient} ()
\item 
static int \hyperlink{class_client_a94b944a8f8349b58dd368deb964fceac}{getPort} ()
\item 
static void $\ast$ \hyperlink{class_client_a7e8f83fbbe3efcd600f8fd8b2d993dd0}{thread\_\-accept} (void $\ast$arg)
\end{DoxyCompactItemize}


\subsection{详细描述}
客户端类 

\hyperlink{client_8h_source}{client.h} \hyperlink{class_client}{Client} header

Lai \begin{DoxyDate}{日期}
July 8 2011
\end{DoxyDate}
This file is part of cute-\/transfer based cracker project, which released under the GNU GPL v2 or v3 (whichever you like) This project is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 单一实例对象 主要负责创建新连接，以及被动监听连接请求， 主动发送消息和文件。 

\subsection{成员函数文档}
\hypertarget{class_client_a772c7deb25a57164e39f6c798140f21e}{
\index{Client@{Client}!addConnection@{addConnection}}
\index{addConnection@{addConnection}!Client@{Client}}
\subsubsection[{addConnection}]{\setlength{\rightskip}{0pt plus 5cm}void Client::addConnection (
\begin{DoxyParamCaption}
\item[{{\bf Connection} $\ast$}]{newCon}
\end{DoxyParamCaption}
)}}
\label{class_client_a772c7deb25a57164e39f6c798140f21e}
添加新Connection对象指针至列表 
\begin{DoxyParams}{参数}
{\em \hyperlink{class_connection}{Connection}} & $\ast$ 连接指针 \\
\hline
\end{DoxyParams}
\hypertarget{class_client_a94b944a8f8349b58dd368deb964fceac}{
\index{Client@{Client}!getPort@{getPort}}
\index{getPort@{getPort}!Client@{Client}}
\subsubsection[{getPort}]{\setlength{\rightskip}{0pt plus 5cm}int Client::getPort (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_client_a94b944a8f8349b58dd368deb964fceac}
返回本机客户端的监听端口 
\begin{DoxyRetVals}{返回值}
{\em int} & 监听端口号 \\
\hline
\end{DoxyRetVals}
\hypertarget{class_client_ae57819d17e2d00f7235adcc99ca13d90}{
\index{Client@{Client}!getSingleClient@{getSingleClient}}
\index{getSingleClient@{getSingleClient}!Client@{Client}}
\subsubsection[{getSingleClient}]{\setlength{\rightskip}{0pt plus 5cm}{\bf Client} $\ast$ Client::getSingleClient (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_client_ae57819d17e2d00f7235adcc99ca13d90}
返回单一client对象的指针。 
\begin{DoxyRetVals}{返回值}
{\em Client$\ast$} & client的指针 \\
\hline
\end{DoxyRetVals}
\hypertarget{class_client_a456d3e393b75a3409d2a4d2991365c33}{
\index{Client@{Client}!startCon@{startCon}}
\index{startCon@{startCon}!Client@{Client}}
\subsubsection[{startCon}]{\setlength{\rightskip}{0pt plus 5cm}void Client::startCon (
\begin{DoxyParamCaption}
\item[{unsigned short}]{port, }
\item[{const char $\ast$}]{addr, }
\item[{const int}]{nRequest, }
\item[{const std::string \&}]{str}
\end{DoxyParamCaption}
)}}
\label{class_client_a456d3e393b75a3409d2a4d2991365c33}
连接接口，并处理指定请求 
\begin{DoxyParams}{参数}
{\em usigned} & short 连接的端口 \\
\hline
{\em const} & char $\ast$ 连接的地址，例如“127.0.0.1” \\
\hline
{\em const} & int 请求类型 0 发送消息 其他值 发送文件 \\
\hline
{\em string} & 消息内容或者文件路径 \\
\hline
\end{DoxyParams}
\hypertarget{class_client_abfd2a6d2e31f7ad05b6003b6900bedcc}{
\index{Client@{Client}!startCon@{startCon}}
\index{startCon@{startCon}!Client@{Client}}
\subsubsection[{startCon}]{\setlength{\rightskip}{0pt plus 5cm}void Client::startCon (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_client_abfd2a6d2e31f7ad05b6003b6900bedcc}
从命令行读入指令并执行 \hypertarget{class_client_a12eaa3ff4cac47109acb0764c0b689bf}{
\index{Client@{Client}!startListen@{startListen}}
\index{startListen@{startListen}!Client@{Client}}
\subsubsection[{startListen}]{\setlength{\rightskip}{0pt plus 5cm}int Client::startListen (
\begin{DoxyParamCaption}
\item[{int}]{lisPort = {\ttfamily 0}}
\end{DoxyParamCaption}
)}}
\label{class_client_a12eaa3ff4cac47109acb0764c0b689bf}
开始监听本地端口 
\begin{DoxyRetVals}{返回值}
{\em int} & 0 监听成功 int -\/1 监听失败 \\
\hline
\end{DoxyRetVals}
\hypertarget{class_client_aef909de08ef481be9e915bd4deb81107}{
\index{Client@{Client}!stopListen@{stopListen}}
\index{stopListen@{stopListen}!Client@{Client}}
\subsubsection[{stopListen}]{\setlength{\rightskip}{0pt plus 5cm}void Client::stopListen (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_client_aef909de08ef481be9e915bd4deb81107}
停止监听本地端口 \hypertarget{class_client_a7e8f83fbbe3efcd600f8fd8b2d993dd0}{
\index{Client@{Client}!thread\_\-accept@{thread\_\-accept}}
\index{thread\_\-accept@{thread\_\-accept}!Client@{Client}}
\subsubsection[{thread\_\-accept}]{\setlength{\rightskip}{0pt plus 5cm}void $\ast$ Client::thread\_\-accept (
\begin{DoxyParamCaption}
\item[{void $\ast$}]{arg}
\end{DoxyParamCaption}
)\hspace{0.3cm}{\ttfamily  \mbox{[}static\mbox{]}}}}
\label{class_client_a7e8f83fbbe3efcd600f8fd8b2d993dd0}
被动阻塞监听外来连接请求的线程函数 \hypertarget{class_client_adfe393bc28758353b25b900d9bb2ea7d}{
\index{Client@{Client}!waitForCon@{waitForCon}}
\index{waitForCon@{waitForCon}!Client@{Client}}
\subsubsection[{waitForCon}]{\setlength{\rightskip}{0pt plus 5cm}void Client::waitForCon (
\begin{DoxyParamCaption}
{}
\end{DoxyParamCaption}
)}}
\label{class_client_adfe393bc28758353b25b900d9bb2ea7d}
等待连接请求并处理 

该类的文档由以下文件生成：\begin{DoxyCompactItemize}
\item 
E:/CODE/CPPpro/cute-\/transfer/Msg\&FileTransfer/client.h\item 
E:/CODE/CPPpro/cute-\/transfer/Msg\&FileTransfer/client.cpp\end{DoxyCompactItemize}
